package com.example.mybatisdemo.demos.web.service;

import com.example.mybatisdemo.demos.web.mapper.UserInfoMapper;
import com.example.mybatisdemo.demos.web.model.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Service
public class UserInfoService {
    @Autowired
    private UserInfoMapper mapper;

    @RequestMapping("/getAllUSer")
public List<UserInfo>getAllUser(){
        return mapper.selectAll();
    }

    public UserInfo getUser(int id) {
        return mapper.selectById(id);
    }
}
